<!DOCTYPE html>
<html lang="en_US" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>登录</title>

    <!-- Bootstrap -->
    <link href="/webjars/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="/webjars/jquery/3.5.1/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>

    <script>
        $(document).ready(function() {
            $('#forgetPassword').modal('show');
        });

        function jump() {
            window.location.href = "http://localhost:8080/departmentAdminPages/login";
        }
    </script>

</head>
<body>
<h1 align="center" th:text="#{studentlogin.title}"></h1>
<font th:color="red" th:align="center">
    <a th:text="${msg}" th:if="${not #strings.isEmpty(msg)}"></a><br/>
</font>

<form class="form-horizontal" th:method="post" th:action="@{/student/login}">
    <div class="form-group">
        <label for="inputUsername3" class="col-sm-2 control-label" th:text="#{studentlogin.username}"></label>
        <div class="col-sm-10">
            <input type="text" name="student_username" class="form-control" id="inputUsername3" th:placeholder="#{studentlogin.username}">
        </div>
    </div>
    <div class="form-group">
        <label for="inputPassword3" class="col-sm-2 control-label" th:text="#{studentlogin.password}"></label>
        <div class="col-sm-10">
            <input type="password" name="student_password" class="form-control" id="inputPassword3" th:placeholder="#{studentlogin.password}">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default" th:text="#{studentlogin.login}"></button>
        </div>
    </div>
</form>

<div class="form-group">
    <p>
        <button type="button" class="btn btn-warning btn-xs" data-toggle="modal" data-target="#forgetPassword" th:text="#{studentlogin.forgetPassword}"></button>
    </p>
</div>

<hr/>

<div class="form-group">
    <label for="inputusername3" class="col-sm-2 control-label" th:text="#{studentlogin.registInformation}"></label>
    <div class="col-sm-10">
        <a class="btn btn-default" th:href="@{/regist}" ref="#" role="button" th:text="#{studentlogin.regist}"></a>
    </div>
</div>

<hr/>
<br/>
<div class="form-group">
    <label for="inputusername3" class="col-sm-2 control-label" th:text="#{studentlogin.departmentAdminInformation}"></label>
    <div class="col-sm-10">
        <p>
            <button type="button" class="btn btn-primary" th:text="#{studentlogin.departmentAdmin}" onclick="jump()"></button>
        </p>
    </div>
</div>

<!-- 添加系的弹出框 -->
<div class="modal fade" id="forgetPassword">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" th:text="#{studentlogin.findPasswordInformation}"></h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" th:method="post" th:action="@{/student/forgetPassword}">
                    <div class="form-group">
                        <label for="student_username" class="col-sm-2 control-label" th:text="#{studentlogin.username}"></label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="student_username" th:name="student_username" th:placeholder="#{studentlogin.username}">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-default" th:text="#{studentlogin.findPassword}"></button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<hr/>
<div th:align="center">
    <a class="btn btn-sm" th:href="@{/login(l='zh_CN')}">中文</a>
    <a class="btn btn-sm" th:href="@{/login(l='en_US')}">English</a>
</div>
</body>
</html>
